import Vue from "vue";
import VueRouter, { RouteConfig } from "vue-router";
import Index from "../views/Index.vue";
import Login from "../views/Login.vue";

const routes: RouteConfig[] = [
  {
    name: "Index",
    path: "/",
    component: () => import("../views/Index.vue")
  },
  {
    name:"Login",
    path: "/login",
    component: () => import("../views/Login.vue")
  }
];  

/**
 * Create route
 * @returns 
 */
export function createRouter(){
  Vue.use(VueRouter);
  const router = new VueRouter({
    mode: "history",
    routes: routes
  });
  return router;
}
